cmake_minimum_required(VERSION 3.5)

project(service-box-unittest)

INCLUDE_DIRECTORIES(/usr/include/)
INCLUDE_DIRECTORIES(/usr/local/protobuf/include)
SET(CMAKE_CXX_FLAGS "-m64 -g -O0 -std=c++17 -DUSE_STATIC_LIB -DTHREADED -DCURL_STATICLIB -Wall -Wno-unused-variable -fnon-call-exceptions")
set(CMAKE_CXX_COMPILER "g++")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}/../../src/repo/src/include/root
  ${PROJECT_SOURCE_DIR}/../../src/repo/src/include/example
  /usr/local/include
)
link_directories(/usr/local/lib)
link_directories(/usr/local/protobuf/lib)
aux_source_directory(. SRC_FILES)
aux_source_directory(${PROJECT_SOURCE_DIR}/../framework SRC_FILES)

link_directories(${PROJECT_SOURCE_DIR}/../../src/repo/lib/root)
link_directories(${PROJECT_SOURCE_DIR}/../../src/repo/lib/proxy/example/ServiceDynamic)
link_directories(${PROJECT_SOURCE_DIR}/../../src/repo/lib/example)
link_directories(${PROJECT_SOURCE_DIR}/../../src/repo/lib/stub/example/ServiceDynamic)
link_directories(${PROJECT_SOURCE_DIR}/../../src/lib)

add_executable (
	service-box-unittest
	${SRC_FILES}    
)

target_link_libraries(service-box-unittest
    libservice_box.a
    librpc.a
    libprotobuf.a
    libzookeeper.a
    libhashtable.a
    libhiredis.a
    libcurl.a
    libz.a
    -Wl,--whole-archive libexample.a libServiceDynamic_proxy.a libServiceDynamic_stub.a -Wl,--no-whole-archive
    -lpthread
    -ldl
)
